using System;
using System.Runtime.InteropServices;

namespace Leap
{
	public class TrackedQuad : Interface
	{
		private HandleRef swigCPtr;

		public float Width => LeapPINVOKE.TrackedQuad_Width_get(swigCPtr);

		public float Height => LeapPINVOKE.TrackedQuad_Height_get(swigCPtr);

		public int ResolutionX => LeapPINVOKE.TrackedQuad_ResolutionX_get(swigCPtr);

		public int ResolutionY => LeapPINVOKE.TrackedQuad_ResolutionY_get(swigCPtr);

		public bool Visible => LeapPINVOKE.TrackedQuad_Visible_get(swigCPtr);

		public Matrix Orientation
		{
			get
			{
				IntPtr intPtr = LeapPINVOKE.TrackedQuad_Orientation_get(swigCPtr);
				return (intPtr == IntPtr.Zero) ? null : new Matrix(intPtr, true);
			}
		}

		public Vector Position
		{
			get
			{
				IntPtr intPtr = LeapPINVOKE.TrackedQuad_Position_get(swigCPtr);
				return (intPtr == IntPtr.Zero) ? null : new Vector(intPtr, true);
			}
		}

		public MaskList Masks
		{
			get
			{
				IntPtr intPtr = LeapPINVOKE.TrackedQuad_Masks_get(swigCPtr);
				return (intPtr == IntPtr.Zero) ? null : new MaskList(intPtr, true);
			}
		}

		public ImageList Images
		{
			get
			{
				IntPtr intPtr = LeapPINVOKE.TrackedQuad_Images_get(swigCPtr);
				return (intPtr == IntPtr.Zero) ? null : new ImageList(intPtr, true);
			}
		}

		public bool IsValid => LeapPINVOKE.TrackedQuad_IsValid_get(swigCPtr);

		public static TrackedQuad Invalid => new TrackedQuad(LeapPINVOKE.TrackedQuad_Invalid_get(), false);

		public TrackedQuad(IntPtr cPtr, bool cMemoryOwn)
			: base(LeapPINVOKE.TrackedQuad_SWIGUpcast(cPtr), cMemoryOwn)
		{
			swigCPtr = new HandleRef(this, cPtr);
		}

		public static HandleRef getCPtr(TrackedQuad obj)
		{
			return obj?.swigCPtr ?? new HandleRef(null, IntPtr.Zero);
		}

		~TrackedQuad()
		{
			Dispose();
		}

		public override void Dispose()
		{
			lock (this)
			{
				if (swigCPtr.Handle != IntPtr.Zero)
				{
					if (base.swigCMemOwn)
					{
						base.swigCMemOwn = false;
						LeapPINVOKE.delete_TrackedQuad(swigCPtr);
					}
					swigCPtr = new HandleRef(null, IntPtr.Zero);
				}
				GC.SuppressFinalize(this);
				base.Dispose();
			}
		}

		public TrackedQuad()
			: this(LeapPINVOKE.new_TrackedQuad(), true)
		{
		}

		public bool Equals(TrackedQuad arg0)
		{
			bool result = LeapPINVOKE.TrackedQuad_Equals(swigCPtr, getCPtr(arg0));
			if (LeapPINVOKE.SWIGPendingException.Pending)
			{
				throw LeapPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public override string ToString()
		{
			return LeapPINVOKE.TrackedQuad_ToString(swigCPtr);
		}
	}
}
